/**
 *
 * @param {ASTNode} astNode
 * @param {{key: String, value: String}} attr
 * @param {Boolean} isDynamic
 */
export function transformAttribute (astNode, attr, isDynamic) {
    const name = attr.key;
    const value = attr.value;

    if (isDynamic) {
        astNode.dynamicAttrMap[name] = value;
    }
    else {
        astNode.staticAttrMap[name] = value;
    }
}

/**
 *
 * @param {ASTNode} astNode
 * @param {{key: String, value: String}} attr
 * @param {Boolean} isDynamic
 */
export function transformEvent (astNode, attr, isDynamic) {
    const name = attr.key;
    const value = attr.value;

    if (isDynamic) {
        astNode.dynamicEventMap[name]
            ? astNode.dynamicEventMap[name].push(value)
            : astNode.dynamicEventMap[name] = [value];
    }
    else {
        astNode.staticEventMap[name]
            ? astNode.staticEventMap[name].push(value)
            : astNode.staticEventMap[name] = [value];
    }
}